//
//  BRPaymentDetailView.m
//  BrezzeSaaS
//
//  Created by IOS on 2021/10/8.
//  Copyright © 2021 Brezze GWG. All rights reserved.
//

#import "BRPaymentDetailView.h"
#import "BRTopTitleTableViewCell.h"
#import "BRDetailTwoTableViewCell.h"
#import "BRDetailOneTableViewCell.h"

#define kContebtMargin_y 180

@interface BRPaymentDetailView ()<QMUITableViewDelegate,QMUITableViewDataSource>
{
    CGFloat _content_h;
    NSArray *_titles;
    UIView *_contentView;
    
    UIImageView *_defaultImg;
    UIImageView *_addImg;
    // // STPPaymentCardTextField (已在新版本中移除) (已在新版本中移除) *_paymentTextField; // 在新版本 Stripe 中不存在，暂时注释
    
    QMUILabel *_depositL;
    QMUILabel *_titleL;
    
    QMUILabel *_addL;
    UIControl *_addBtn ;
    QMUIButton *_submitBtn;
}

@end

@implementation BRPaymentDetailView

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        _titles = @[Localized(@"Order_orderTime"),Localized(@"Order_duration"),Localized(@"Order_coupon"),Localized(@"Order_amount"),Localized(@"Payment_orderId"),Localized(@"Station_pricePlan")];
        _content_h = kScreenHeight - (kSafeAreaTopHeight + kContebtMargin_y);
        [self setUI];
    }
    return self;
}

- (instancetype)initAddViewWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        self.type = 1;
        _content_h = kScreenHeight - (kSafeAreaTopHeight + kContebtMargin_y);
        [self setUI];
    }
    return self;
}

- (instancetype)initDepositWithFrame:(CGRect)frame {
    self = [super initWithFrame:frame];
    if (self) {
        self.type = 2;
        _content_h = kScreenHeight - (kSafeAreaTopHeight + kContebtMargin_y);
        [self setUI];
    }
    return self;
}

- (void)hidd  {
    [self endEditing:YES];
    [UIView animateWithDuration:0.25 animations:^{
        self->_contentView.transform = CGAffineTransformMakeRotation(0);
    } completion:^(BOOL finished) {
        self.hidden =  YES;
    }];
}

- (void)show {
    self.hidden = NO;
    [UIView animateWithDuration:0.25 animations:^{
        self->_contentView.transform = CGAffineTransformMakeTranslation(0, -(self->_content_h));
    }];
}

- (void)br_becomeFirst {
    // // // [_paymentTextField (已注释) (已注释) becomeFirstResponder]; // 修复：_paymentTextField 已注释，暂时注释此行
}


- (void)toSetDefaultCard {
    self.isDefault = !self.isDefault;
}

- (void)toSetAddCard {
    self.isAdd = !self.isAdd;
}

- (void)setIsDefault:(BOOL)isDefault {
    _isDefault = isDefault;
    UIImage *selImg = UIImage.qd_defauSelImg;
    UIImage *unselImg = UIImage.qd_defauUnSelImg;
    _defaultImg.image = isDefault == YES ? selImg : unselImg;
}

- (void)setIsAdd:(BOOL)isAdd {
    _isAdd = isAdd;
    UIImage *selImg = UIImageMake(@"pay_default");
    UIImage *unselImg = UIImageMake(@"pay_undefault");
    _addImg.image = isAdd == YES ? selImg : unselImg;
    
}

- (void)didClickScanButton {
    // // // [_paymentTextField (已注释) (已注释) resignFirstResponder]; // 修复：_paymentTextField 已注释，暂时注释此行
    if (self.toScan) {
        self.toScan();
    }
}

- (void)setCouponAmount:(CGFloat)couponAmount {
    _couponAmount = couponAmount;
    
    [self.tableView reloadData];
}

- (void)setDto:(BROrderListModel *)dto {
    _dto  = dto;
    
    [self.tableView reloadData];
}

// 修复：整个方法依赖于 _paymentTextField，暂时注释
/*
- (STPCardParams *)cardParams {
    
    ///判断卡信息是否有误
    if (!// // [_paymentTextField (已注释) (已注释) isValid]) {
        
        [BRHud showAuto:Localized(@"wallet_notSupportedMsg") inView:self];
        return nil;
        
    }
    STPCardParams *params = [[STPCardParams alloc] init];
    params.number = // // _paymentTextField. (已注释) (已注释)cardParams.number;
    params.expYear = // // _paymentTextField. (已注释) (已注释)cardParams.expYear.unsignedIntValue;
    params.expMonth = // // _paymentTextField. (已注释) (已注释)cardParams.expMonth.unsignedIntValue;
    params.cvc = // // _paymentTextField. (已注释) (已注释)cardParams.cvc;
   
    if (// // _paymentTextField. (已注释) (已注释)postalCode.length != 0) {
        params.addressZip = // // _paymentTextField. (已注释) (已注释)postalCode;
    }
    
    return  params;
}
*/

// 修复：整个方法依赖于 _paymentTextField，暂时注释
/*
- (STPPaymentMethodCardParams *)paymentMethodCardParams {
    ///判断卡信息是否有误
    if (!// // [_paymentTextField (已注释) (已注释) isValid]) {
        
        [BRHud showAuto:Localized(@"wallet_notSupportedMsg") inView:self];
        return nil;
        
    }
    return  // // _paymentTextField. (已注释) (已注释)cardParams;
}
*/


// 修复：整个方法依赖于 _paymentTextField，暂时注释
/*
- (void)setPaymentMethodCardParams:(STPPaymentMethodCardParams *)paymentMethodCardParams {
    
    // // _paymentTextField. (已注释) (已注释)cardParams = paymentMethodCardParams;
}
*/

- (void)setIsLost:(BOOL)isLost {
    _isLost = isLost;
    _titleL.text = Localized(@"Report_reportLost");
    _depositL.text = [NSString stringWithFormat:Localized(@"Report_lostDescribe"),USERManager.currency.uppercaseString,USERManager.lostPrice.floatValue];
}


- (void)showPre:(NSString*)sno{
    _sno = sno;
    _addImg.hidden = NO;
    _addL.hidden = NO;
    _addBtn.hidden = NO;
    _submitBtn.hidden = NO;
    
}

#pragma mark 去支付
-(void)goToPay{
    
    NSMutableDictionary *dic = [[NSMutableDictionary alloc] init];
    dic[@"scanUrl"] = self.sno;
    dic[@"source"] = @"1";
    dic[@"paymentChannel"] = @"stripe";
    dic[@"rentType"] = @"1";
    dic[@"scene"] = @"1";
    
    [self payAddCard:dic];
}


- (void)payAddCard:(NSDictionary *)dic {
    

    
    NSMutableDictionary *dict = [NSMutableDictionary  dictionaryWithDictionary:dic];
    [[BRPayManager share] checkCard:self.cardParams isDefault:self.isDefault succ:^(BRAddCardModel * _Nonnull addModel) {
             
       
//        NSDictionary
        NSMutableDictionary *dickey = [addModel mj_keyValues];
      
        if (self->_isAdd) {

            [dickey setObject:@(YES) forKey:@"save"];
        }
        dict[@"bankcardInfo"]  = dickey;

        
        NSLog(@"bankcardInfo ==%@",dict);
        [BRHud showInView:self];
        
        //1:先判断授权是否有资格
        [[BRRequestManager shared] POST:[BRAPI preRent] params:dict succeed:^(NSDictionary * _Nonnull dataDict, NSInteger respCode) {

            BRPreRentModel *model = [BRPreRentModel mj_objectWithKeyValues:dataDict[@"data"]];
           
            BROrderDetailModel *dto = [BROrderDetailModel mj_objectWithKeyValues:model.order];

            NSLog(@"%@",dataDict);
            
            if (model.resp.status == 11) {
                
                if (self.prePaySucc) self.prePaySucc(dto.orderNo);

                return;
            }
            
            if (model.resp!=nil) {
                
                if ([model.resp.displayMode isEqualToString:@"app"]&&model.resp.displayContent.length >0) {
             
                    //租借场景:1.预授权租借 2.已授权租借 3.白名单租借
                    NSLog(@"预授权成功--111");
       
                    
                    //2:先支付是否成功
    //                model.clientSecret
                    [[BRPayManager share] pre_toConfirmStPay:model.resp.displayContent succ:^(NSString *stripeId) {
                  
                        
                        [BRHud hiddenInView:self];
                        NSLog(@"预授权成功--222");
                        
                        if (self.prePaySucc) self.prePaySucc(dto.orderNo);
                        
                    } fail:^(NSString *errMsg, NSInteger code) {
                        [BRHud hiddenInView:self];
                        
                        [BRHud showAuto:[NSString stringWithFormat:@"ST-%@(%ld)",errMsg,code]];
                    }];
                    
                    return;
                    
                }

     
            }else if (model.success ==  2){
                
                NSLog(@"预授权成功-2：失败");
                [BRHud showAuto:Localized(@"失败")];
            }else if (model.success ==  3){
                
                NSLog(@"需要校验");
                
            }
            
            
            if (BR_StringIsEmpty(model.resp.displayContent)) {
                [BRHud hiddenInView:self];
                
                [BRHud showAuto:Localized(@"home_failed")];
                
                return;
            }
            

        } failed:^(NSInteger code, NSString * _Nonnull errMsg) {
            [BRHud hiddenInView:self];
        }];
        
        
    } faile:^{
        [BRHud hiddenInView:self];
    }];
    

}

#pragma mark - // // // STPPaymentCardTextField (已在新版本中移除) (已在新版本中移除) (已在新版本中移除)Delegate
// 修复：// // // STPPaymentCardTextField (已在新版本中移除) (已在新版本中移除) (已在新版本中移除) 在新版本 Stripe 中不存在，暂时注释
/*- (void)paymentCardTextFieldDidChange:(// // // STPPaymentCardTextField (已在新版本中移除) (已在新版本中移除) (已在新版本中移除) *)textField {
    _submitBtn.enabled = textField.isValid;
}*/

#pragma mark - tableView Delegate --
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
    if (indexPath.row == 5) {
        return UITableViewAutomaticDimension;
    }
    return 72;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    return _titles.count;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{

    if (indexPath.row == _titles.count - 1) {
        
         BRDetailTwoTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"BRDetailTwoTableViewCell"];
        cell.title_Lx.constant = 28;
        cell.title_Rx.constant = 28;
        cell.titleLB.text = _titles[indexPath.row];
        NSString *text = USERManager.rentRule;
        cell.contentLB.text = text;
        NSMutableAttributedString *att = [[NSMutableAttributedString alloc] initWithString:text];
        att.yy_font = [UIFont br_fontM:14];
        att.yy_lineSpacing = 2;
        cell.contentLB.attributedText = att;
        
        
         return cell;
         
    }
    
    if (indexPath.row == 2) {
        BRDetailOneTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"BRDetailOneTableViewCell"];
        [cell changeStyle:1];
        [cell singleLabel:NO];
        CGFloat line_x = 28.f;
        cell.line_x.constant = line_x;
        cell.line_x2.constant = line_x;
        cell.stack_x.constant = line_x;
        NSString *title = _titles[indexPath.row];
        NSString *title2 = Localized(@"Rewards_promoCode");
        NSString *contentStr  = [NSString stringWithFormat:@"%@%.2f",USERManager.currency.uppercaseString,self.couponAmount];
        NSString *contentStr2 = [NSString stringWithFormat:@"%@%.2f",USERManager.currency.uppercaseString,self.dto.promoCodeAmount.floatValue];
        
        cell.titlelLB1.text = title;
        cell.contentLB1.text = contentStr;
        cell.titleLB2.text = title2;
        cell.contentLB2.text = contentStr2;
        
        return cell;
    }
    
    BRTopTitleTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"BRTopTitleTableViewCell"];
    cell.contentView.backgroundColor = UIColor.qd_backgroundColor2;
    cell.lineView.backgroundColor = UIColor.qd_lineColor2;
    cell.titleL.text = _titles[indexPath.row];
    cell.titleL.textColor = UIColor.qd_descriptionTextColor;
    cell.rightImg.hidden = YES;
    
    if (self.dto) {
        switch (indexPath.row) {
            case 0:{
                cell.subTitleL.text = [BRTools getTimeFromTimestamp:self.dto.createTime.integerValue formatter:kBRDateFormatterdMy];
                break;
            }
            case 1:{
                cell.subTitleL.text = [BRTools getFormatTimeFromDurationTime:self.dto.useDuration];
                break;
            }
            case 3:{
                CGFloat newPrice = self.dto.money.floatValue - self.couponAmount;
                if (newPrice < 0) {
                    newPrice = 0;
                }
                cell.subTitleL.text = [NSString stringWithFormat:@"%@%.2f",USERManager.currency.uppercaseString,newPrice];
                break;
            }
            case 4:{
                cell.subTitleL.text = self.dto.orderNo;
                break;
            }
            default:
                break;
        }
    }
    
    return cell;
    
}

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
    
    
}


#pragma mark - Set UI --
- (void)setUI  {
    
    self.backgroundColor = UIColorMakeWithRGBA(0, 0, 0, 0.38);
    
    UIView *contentView = [[UIView alloc] initWithFrame:CGRectMake(0, kScreenHeight, kScreenWidth, _content_h)];
    contentView.backgroundColor = UIColor.qd_backgroundColor2;
    [self addSubview:contentView];
    [contentView  layoutIfNeeded];
    // 设置顶部圆角
    // 绘制圆角 需设置的圆角 使用"|"来组合
    UIBezierPath *maskPath = [UIBezierPath bezierPathWithRoundedRect:contentView.bounds byRoundingCorners:UIRectCornerTopLeft |
    UIRectCornerTopRight cornerRadii:CGSizeMake(25, 25)];
    CAShapeLayer *maskLayer = [[CAShapeLayer alloc]init];

    // 设置大小
    maskLayer.frame = contentView.bounds;

    // 设置图形样子
    maskLayer.path = maskPath.CGPath;
    contentView.layer.mask = maskLayer;
    _contentView = contentView;
    
    QMUIButton *backBtn = [[QMUIButton alloc] initWithFrame:CGRectMake(kScreenWidth - 52, 8, 44, 44)];
    [backBtn setBackgroundImage:UIImageMake(@"arrow_close_gray44") forState:UIControlStateNormal];
    [contentView addSubview:backBtn];
    
    [backBtn addTarget:self action:@selector(hidd) forControlEvents:UIControlEventTouchUpInside];
    
    QMUILabel *titleL = [[QMUILabel alloc] init];
    titleL.textAlignment = NSTextAlignmentLeft;
    titleL.textColor = UIColor.qd_titleTextColor;
    titleL.text = Localized(@"Order_chargeDetails");
    titleL.font = [UIFont br_fontB:17];
    [contentView addSubview:titleL];
    [titleL mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.equalTo(backBtn).offset(0);
        make.centerX.equalTo(contentView).offset(0);
    }];
    _titleL = titleL;
    if (self.type == 1) {
        titleL.text = Localized(@"pay_payByCard");
        [self createPayWitCardView];
    }else if (self.type == 2) {
        
        titleL.text = Localized(@"Payment_deposit");
        [self createDepositLabel];
    }else {
        [self createTableView];
    }
    
    self.hidden = YES;
}

- (void)createTableView {
    
    [_contentView addSubview:self.tableView];
    self.tableView.delegate = self;
    self.tableView.dataSource = self;
    [self.tableView registerNib:[UINib nibWithNibName:NSStringFromClass([BRTopTitleTableViewCell class]) bundle:nil] forCellReuseIdentifier:@"BRTopTitleTableViewCell"];
    [self.tableView registerNib:[UINib nibWithNibName:NSStringFromClass([BRDetailTwoTableViewCell class]) bundle:nil] forCellReuseIdentifier:@"BRDetailTwoTableViewCell"];
    [self.tableView registerNib:[UINib nibWithNibName:NSStringFromClass([BRDetailOneTableViewCell class]) bundle:nil] forCellReuseIdentifier:@"BRDetailOneTableViewCell"];
    
    if (@available(iOS 11.0, *)) {
        self.tableView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;
    }
}

- (void)createPayWitCardView {
    
    QMUILabel *addText = [[QMUILabel alloc] init];
    addText.text = Localized(@"pay_enterBankCard");
    addText.textColor = UIColor.qd_titleTextColor2;
    addText.font = [UIFont br_fontS:14];
    addText.textAlignment = NSTextAlignmentLeft;
    addText.numberOfLines = 0;
    [_contentView addSubview:addText];
    [addText mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(_contentView.mas_left).offset(36);
        make.right.equalTo(_contentView.mas_right).offset(-36);
        make.top.equalTo(_contentView.mas_top).offset(72);
    }];
    
    UIView *cardBgView = [UIView new];
    cardBgView.backgroundColor = UIColor.qd_backgroundColorLighten;
    cardBgView.layer.cornerRadius = kCorners;
    cardBgView.layer.masksToBounds = YES;
    [_contentView addSubview:cardBgView];
    [cardBgView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(addText.mas_bottom).offset(12);
        make.left.equalTo(_contentView).offset(kMarginLR2);
        make.right.equalTo(_contentView).offset(-kMarginLR2);
        make.height.mas_equalTo(60);
    }];
    
    QMUIButton *scanButton = [[QMUIButton alloc] init];
    [scanButton setBackgroundImage:UIImageMake(@"faq_camera") forState:UIControlStateNormal];
    [scanButton addTarget:self action:@selector(didClickScanButton) forControlEvents:(UIControlEventTouchUpInside)];
    [cardBgView addSubview:scanButton];
    [scanButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.width.mas_equalTo(44);
        make.height.mas_equalTo(44);
        make.centerY.equalTo(cardBgView);
        make.right.equalTo(cardBgView).offset(-16);
    }];
    
    // 修复：// // // STPPaymentCardTextField (已在新版本中移除) (已在新版本中移除) (已在新版本中移除) 在新版本 Stripe 中不存在，暂时注释整个支付卡输入框的创建
    /*
    // // // STPPaymentCardTextField (已在新版本中移除) (已在新版本中移除) (已在新版本中移除) *paymentTextField = [[// // // STPPaymentCardTextField (已在新版本中移除) (已在新版本中移除) (已在新版本中移除) alloc] init];
    paymentTextField.postalCodeEntryEnabled = NO;
    paymentTextField.backgroundColor = UIColorClear;
    paymentTextField.delegate = self;
    paymentTextField.borderWidth = 0;
    paymentTextField.expirationPlaceholder = Localized(@"wallet_stripeMMYY");
    paymentTextField.cursorColor = kColorMain;
    paymentTextField.textColor = UIColor.qd_titleTextColor;
    [cardBgView addSubview:paymentTextField];
    [paymentTextField mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(cardBgView);
        make.top.bottom.equalTo(cardBgView);
        make.right.equalTo(cardBgView).with.offset(-66);
        
    }];
    paymentTextField.postalCodeEntryEnabled = YES;
    _paymentTextField = paymentTextField;
    */
    
    
    // set default
//    UIImageView *defaultImg = [[UIImageView alloc] init];
//    defaultImg.image = UIImage.qd_defauUnSelImg;
//    [_contentView addSubview:defaultImg];
//    [defaultImg mas_makeConstraints:^(MASConstraintMaker *make) {
//        make.top.equalTo(cardBgView.mas_bottom).offset(30);
//        make.width.height.mas_equalTo(18);
//        make.left.equalTo(cardBgView);
//    }];
//
//    _defaultImg = defaultImg;
//
//    QMUILabel *defaultL = [[QMUILabel alloc] init];
//    defaultL.text = Localized(@"Card_setDefaultText");
//    defaultL.textColor = UIColor.qd_titleTextColor2;;
//    defaultL.font = [UIFont br_fontS:14];
//    defaultL.textAlignment = NSTextAlignmentLeft;
//    defaultL.numberOfLines = 0;
//    [_contentView addSubview:defaultL];
//    [defaultL mas_makeConstraints:^(MASConstraintMaker *make) {
//        make.left.equalTo(defaultImg.mas_right).offset(8);
//        make.right.equalTo(_contentView.mas_right).offset(-36);
//        make.centerY.equalTo(defaultImg);
//    }];
//
//    UIControl *defBtn = [[UIControl alloc] init];
//    [_contentView addSubview:defBtn];
//    [defBtn mas_makeConstraints:^(MASConstraintMaker *make) {
//        make.centerY.centerX.equalTo(defaultImg);
//        make.width.height.mas_equalTo(40);
//    }];
//    [defBtn addTarget:self action:@selector(toSetDefaultCard) forControlEvents:UIControlEventTouchUpInside];
    
    // set add
    UIImageView *addImg = [[UIImageView alloc] init];
    addImg.image = UIImageMake(@"pay_undefault");
    [_contentView addSubview:addImg];
    [addImg mas_makeConstraints:^(MASConstraintMaker *make) {
//        make.top.equalTo(defaultImg.mas_bottom).offset(26);
        make.top.equalTo(cardBgView.mas_bottom).offset(30);
        make.width.height.mas_equalTo(14);
        make.left.equalTo(cardBgView);
    }];
    
    _addImg = addImg;
    
    QMUILabel *addL = [[QMUILabel alloc] init];
    addL.text = Localized(@"pay_addCardToWallet");
    addL.textColor = UIColor.qd_titleTextColor2;
    addL.font = [UIFont br_fontS:14];
    addL.textAlignment = NSTextAlignmentLeft;
    addL.numberOfLines = 0;
    [_contentView addSubview:addL];
    [addL mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(addImg.mas_right).offset(8);
        make.right.equalTo(_contentView.mas_right).offset(-36);
        make.centerY.equalTo(addImg);
    }];
    
    _addL =addL;
    UIControl *addBtn = [[UIControl alloc] init];
    [_contentView addSubview:addBtn];
    [addBtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.centerX.equalTo(addImg);
        make.width.height.mas_equalTo(40);
    }];
    [addBtn addTarget:self action:@selector(toSetAddCard) forControlEvents:UIControlEventTouchUpInside];
    
    _addBtn =addBtn;
    
    _addImg.hidden = YES;
    _addL.hidden = YES;
    _addBtn.hidden = YES;
    
    
    _submitBtn = [BRToolsView br_btnBGImg:Localized(@"home_go2pay")];

    [self addSubview:_submitBtn];
    [_submitBtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.height.mas_equalTo(52);
        make.width.mas_equalTo(kScreenWidth - 56);
        make.centerX.equalTo(self);
        make.bottom.equalTo(self.mas_bottom).offset(-50);
    }];
    [_submitBtn addTarget:self action:@selector(goToPay) forControlEvents:UIControlEventTouchUpInside];
    _submitBtn.enabled = NO;
    _submitBtn.hidden = YES;
  
  
}

- (void)createDepositLabel {
    
    QMUILabel *depL = [[QMUILabel alloc] initWithFrame:CGRectMake(0,60, kScreenWidth, _content_h - 60)];
    depL.textColor = UIColor.qd_titleTextColor;
    depL.font = [UIFont br_fontM:14];
    depL.numberOfLines = 0;
    depL.textAlignment = NSTextAlignmentLeft;
    [_contentView addSubview:depL];
    [depL mas_makeConstraints:^(MASConstraintMaker *make) {
        make.width.mas_equalTo(kScreenWidth - 56);
        make.centerX.equalTo(_contentView);
        make.top.equalTo(_contentView.mas_top).offset(60);
    }];
    
    depL.text = Localized(@"Payment_depositMsg");
    
    _depositL = depL;
    
}

- (QMUITableView *)tableView{
    if (!_tableView) {
        _tableView = [[QMUITableView alloc] initWithFrame:CGRectMake(0,60, kScreenWidth, _content_h - 60) style:UITableViewStylePlain];
        _tableView.tableFooterView = [UIView new];
        _tableView.estimatedRowHeight = 72;
        _tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
        _tableView.showsVerticalScrollIndicator = NO;
        _tableView.backgroundColor = [UIColor clearColor];
        _tableView.keyboardDismissMode = UIScrollViewKeyboardDismissModeOnDrag;
    }
    return _tableView;
}

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
